<?php

function __autoload($class_name) 
{
    require_once "$class_name.class.php";
}

//gc_disable();
$baseMemory = memory_get_usage();
$basePeakMemory=memory_get_peak_usage();
$b=new Profil("b");
$c=new Profil("c");
for ( $i = 0; $i <= 500000; $i++ )
{
    $c=$b;
	$a=$b;
	$a = new Profil("$i");
	$c->self=$b;
	$b->self=$c;
	$a->self=$a;
    if ( $i % 10000 === 0 )
    {
        echo sprintf( '%8d %8d %8d', $i , (memory_get_usage() - $baseMemory),(memory_get_peak_usage() - $basePeakMemory));
		echo "\n";
    }
	$a->setParrain($b);
	$b->setParrain($c);
	
}
?>